package org.dna.metronomo.persistence;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface ActivityMapper {
	@Insert("INSERT INTO Activity (name, description, status) VALUES (#{name}, #{description}, #{status})")
	void insert(Activity activity);
	
	@Delete("DELETE FROM Activity WHERE idActivity=#{id}")
	void deleteByID(Integer id);

	@Update("UPDATE Activity SET status = #{status} WHERE idActivity=#{id}")
	void updateStatusByID(@Param("id") Integer id, @Param("status") String status);
	
	@Update("UPDATE Activity SET name = #{name}, description=#{description}, status = #{status} WHERE idActivity=#{id}")
	void update(Activity activity);
}
